{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "0b4e8246-bfbf-4624-90be-e96c1f0b4d59",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Mental Rotation\n",
    "def get_Mental_useful_cols(data):\n",
    "    useful_mentalrotation_cols = ['response.keys',\n",
    "                                  'response.corr',\n",
    "                                  'response.rt',\n",
    "                                  'pic_orientation',\n",
    "                                  'trial_type',\n",
    "                                  '请填写您的姓名：',\n",
    "                                  '请填写您的学号：']\n",
    "    data = data[useful_mentalrotation_cols]\n",
    "    return data\n",
    "\n",
    "import pandas as pd\n",
    "# 读取文件\n",
    "data = pd.read_csv('蒋倩_Mental_Rotation_2021_Nov_13_1420.csv',engine='python',sep=',')\n",
    "# 选中需要进行分析的列\n",
    "data = get_Mental_useful_cols(data)\n",
    "# 删掉空行\n",
    "data = data.dropna(how='all')\n",
    "# output\n",
    "new_name = '蒋倩' + '_' + 'cleaned' + '.xlsx' \n",
    "data.to_excel(new_name)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6c224fda-6a4f-4179-99fe-1e57609cb692",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
